﻿using System;
using UnityEngine.SceneManagement;
using UnityEngine;


namespace Manager{
	public class GameManager :BaseManager
	{
        [SerializeField, Range(0.2f, 2.0f), Header("timeScale")]
        private float DebugTimeScale = 1;
        [HideInInspector]
		public static GameManager instance;
        [HideInInspector]
		public ResourceManager resourceManager;
        [HideInInspector]
		public NetWorkManager networkManager;
        [HideInInspector]
		public WindowManager windowManager;
        [HideInInspector]
        public LogManager logManager;
		//游戏初始化
		protected override void Initialization ()
		{
            Time.timeScale = DebugTimeScale;
			//初始化游戏中用到的管理器
            instance = this;
            //初始化机器腿
            GameContext.InitRobotLegs(transform);
            //实例化场景
            //gameObject.AddComponent<SceneView>();
            //初始化资源管理
            //resourceManager = gameObject.AddComponent<ResourceManager>();
            //resourceManager.CheckResource(OnResourceUpdateComplete);
            EventProcess.Rigester(Notify.NetWork_ConnectSuccess, OnConnectSuccess);
            NetWorkManager.singleton.ConnectServer("192.168.70.166", 8001);

		}

        private void OnConnectSuccess(object obj)
        {
            Debug.LogError("发送登录");
            NetWorkManager.singleton.Login();
        }

        private void OnResourceUpdateComplete()
        {

        }

	}
}

